/**
 * 
 */
package net.sahv.bdyz.service;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import net.sahv.bdyz.mapper.PatternFilterMapper;
import net.sahv.bdyz.model.PatternFilter;

/**
 * @author 张天敏
 * @date 日期：2016年8月3日 时间：下午4:28:02
 */
@Service
public class PatternFilterService {
	
	@Autowired
	private PatternFilterMapper patternFilterMapper;
	
    public int deleteByPrimaryKey(Integer ptId){
    	return patternFilterMapper.deleteByPrimaryKey(ptId);
    }
    //添加
    public int insert(PatternFilter record){
    	return patternFilterMapper.insert(record);
    }

    public PatternFilter selectByPrimaryKey(Integer ptId){
    	return patternFilterMapper.selectByPrimaryKey(ptId);
    }
    //查找所有
    public List<PatternFilter> selectAll(){
    	return patternFilterMapper.selectAll();
    }
    //修改
    public int updateByPrimaryKey(PatternFilter record){
    	return patternFilterMapper.updateByPrimaryKey(record);
    }
    //修改状态为删除
    public int updateDeleteById(Integer[] id)
    {
    	return patternFilterMapper.updateDeleteById(id);
    }
    //根据ID查找本条记录
    public List<PatternFilter> selectAllBypid(int pId, String yuyan) {
  		return patternFilterMapper.selectAllBypid(pId,yuyan);
  	}

    //所有记录
	public List<Map<String, Object>> getList(Map<String, Object> param) {
		return patternFilterMapper.getList(param);
	}
	//花型预设标签（大类列表）
	public List<Map<String, Object>> getTwoParentList(Map<String, Object> param) {
		return patternFilterMapper.getTwoParentList(param);
	}
	//花型预设标签（大类列表）记录总数
	public Integer getTotalCountParent() {
		return patternFilterMapper.getTotalCountParent();
	}
	//统计记录数量
	public Integer getTotalCount(Integer where) {
		return patternFilterMapper.getTotalCount(where);
	}
	//根据ID查找父级内容
	public PatternFilter findById(Integer id) {
		return patternFilterMapper.findById(id);
	}
	//父级列表
	public List<PatternFilter> findParentList() {
		return patternFilterMapper.findParentList();
	}
	//花型预设标签父级列表
	public List<PatternFilter> findParentListBig() {
		return patternFilterMapper.findParentListBig();
	}
    //根据父级名称查询出子级
    public List<PatternFilter> selectAllByParentName(String name)
    {
    	return patternFilterMapper.selectAllByParentName(name);
    }

	/**
	 * @author 作者 : 任凯伟
	 * @date 创建时间：2016年9月30日 上午11:03:28
	 * @version 1.0
	 * @see
	 * @param
	 * @parameter
	 * @since
	 * @return
	 */
	public List<PatternFilter> getListByIds(String ids) {
		return patternFilterMapper.getListByIds(ids);
	}
	public List<PatternFilter> selectAllYushe() {
		return patternFilterMapper.selectAllYushe();
	}

	/**
	 * @author 作者 : 任凯伟
	 * @date 创建时间：2016年10月12日 下午2:04:43
	 * @version 1.0
	 * @see
	 * @param
	 * @parameter
	 * @since
	 * @return
	 */
	public List<PatternFilter> selectByName(String where) {
		return patternFilterMapper.selectByName(where);
	}

	/**
	 * @author 作者 : 任凯伟
	 * @date 创建时间：2016年10月14日 下午2:23:22
	 * @version 1.0
	 * @see
	 * @param pId
	 *            父类id
	 * @since
	 * @return
	 */
	public List<PatternFilter> getChildList(int pId) {
		return patternFilterMapper.getChildList(pId);
	}
}
